import App from './App'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
import uView from '@/uni_modules/uview-ui'
import SvgIcon from '@/components/SvgIcon.vue';
import EmptyView from '@/components/EmptyView.vue';
Vue.use(uView)
Vue.component('svg-icon', SvgIcon);
Vue.component('empty-view', EmptyView);
const app = new Vue({
  ...App
})
app.$mount()
// #endif

window.addEventListener('beforeunload', function (event) {
  const confirmationMessage = '继续刷新将离开该页面';
  event.returnValue = confirmationMessage;
  return confirmationMessage;
});
window.addEventListener('load', function (event) {
      uni.reLaunch({
        url: '/pages/index/index'
      });
});

//数据请求封装
import http from './common/request.js'
Vue.prototype.$http = http;

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif